
import 'package:base_flutter/base_flutter.dart';

class CodeValueEntity {
  final int? total;
  List<CodeValue>? rows;

  CodeValueEntity({this.rows, this.total});

  factory CodeValueEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['rows'] as List;
    List<CodeValue> protocolList =
        originList.map((value) => CodeValue.fromJson(value)).toList();
    return CodeValueEntity(rows: protocolList, total: json['total']);
  }
}

class CodeValue implements IPickerData{
  String? nameCn;
  String? codeValue;
  String? mobile;
  String? relationshipName;
  int? relationshipId;
  int? id;

  CodeValue({
    this.codeValue,
    this.nameCn,
    this.id,
    this.mobile,
    this.relationshipName,
    this.relationshipId,
  });

  CodeValue.fromJson(Map data) {
    relationshipId = data["relationshipId"];
    relationshipName = data["relationshipName"];
    mobile = data["mobile"];
    codeValue = data['codeValue'];
    nameCn = data['nameCn'];
    name = data["name"];
    id = data["id"];
  }

  Map<String, dynamic> toJson() {
    return {
      'nameCn': this.nameCn,
      'codeValue': this.codeValue,
      'name': this.name,
      'mobile': this.mobile,
      'relationshipName': this.relationshipName,
      'relationshipId': this.relationshipId,
      'id': this.id,
    };
  }

  @override
  String get name => nameCn??"";

  @override
  set name(String _name) {
  }

}
